### Common Installation Commands ###
install: db-create db-fixture-load perl-deps js-files
clean: db-drop
reload: db-load-dumpfile

example: lib/install/example-data.pl
	perl lib/install/example-data.pl

### .js fixture files ###
js-files: bin/mk_facts_js.pl
	bin/mk_facts_js.pl

### perl dependencies ###
## this just identifies which deps need install via CPAN
perl-deps: lib/perl/Makefile.PL
	cd lib/perl && perl Makefile.PL

### Smoketest ###
smoketest: clean install check html


### build search indexes
search: bin/mk_search.pl
	bin/mk_search.pl --xml --prune --indexes

xml:    bin/mk_search.pl
	bin/mk_search.pl --xml

prune:  bin/mk_search.pl
	bin/mk_search.pl --prune

indexes: bin/mk_search.pl
	bin/mk_search.pl --indexes

search-server-restart: bin/search-server
	bin/search-server restart


### Documentation
docs: doc/book/air2.xml
	bin/mk_docs.pl --pdf --html

pdf: doc/book/air2.xml
	bin/mk_docs.pl --pdf

html: doc/book/air2.xml
	bin/mk_docs.pl --html


### Testing Commands ###
check: tests/Test.php
	prove -r tests
test: check


##
# Some Database create/delete commands
##
db-create: lib/install/create.php
	php lib/install/create.php
db-drop: lib/install/drop.php
	php lib/install/drop.php
db-fixture-load: lib/install/load.php
	php lib/install/load.php
	php lib/install/loadtags.php
db-load-dumpfile: lib/install/loaddump.php
	php lib/install/loaddump.php $(DBNAME) $(DBUSER) $(DBPASS)



##
# Data to bootstrap for development purposes
##
dev-load-full: lib/devfixtures/project-data.php
	php lib/devfixtures/project-data.php
	php lib/devfixtures/bin-data.php
	php lib/devfixtures/tag-data.php
